﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Presentation;
using System.IO;

namespace Infrastructure
{
    public class HTMLLogger : ILogger
    {
        private const String LOG_FILE = "log.html";
        public HTMLLogger()
        {
            StreamWriter file = new StreamWriter(LOG_FILE, false);
            file.Close();
        }
        public void Write(String str)
        {
            str = str + "<br>";
            StreamWriter file = new StreamWriter(LOG_FILE, true);
            file.WriteLine(str);
            file.Close();
        }

        public String Read()
        {
            StreamReader file = new StreamReader(LOG_FILE);
            String retVal = file.ReadToEnd();
            file.Close();
            return retVal;
        }
    }
}
